<?php

class BackendSessionForm extends sfForm
{
  public function configure()
  {
    $this->setWidgets(array(
      'account' => new sfWidgetFormInputText(),
      'password' => new sfWidgetFormInputPassword()
    ));

    $this->setValidators(array(
      'account' => new sfValidatorString(
        array(),
        array('required' => '帐号不能为空')
      ),
      'password' => new sfValidatorString(
        array(),
        array('required' => '密码不能为空')
      )
    ));

    $this->validatorSchema->setPostValidator(new BackendDoctrineValidatorAdmin());

    $this->widgetSchema->setNameFormat('session[%s]');
  }
}
